package gang.org.springframework.framework.metadata;

import java.lang.annotation.Annotation;
import java.util.Map;
import java.util.function.Function;

/**
 * @author gang.chen
 * @description
 * @Date 2021/6/30 7:57
 */
public abstract class GangAbstractMergedAnnotation<A extends Annotation> implements GangMergedAnnotation<A> {
    @Override
    public GangAnnotationAttributes asAnnotationAttributes(GangAdapt... adaptations) {
        /*
         * 3个重要参数
         * 3.1 Function -> new GangAnnotationAttributes(gangMergedAnnotation.getType())
         * 3.2 this     -> GangAbstractMergedAnnotation
         * 3.3 函数式接口方法的本质
         * */
        return asMap(gangMergedAnnotation-> new GangAnnotationAttributes(gangMergedAnnotation.getType()),adaptations);
    }
}
